<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function del(){
				
				var $uid=uid.value;
				console.log($uid)
				if (!$uid){alert("输入的值不能为空");return}
			
				var xhr=new XMLHttpRequest();
				xhr.onreadystatechange=function(){
					if(xhr.readyState==4 && xhr.status==200){
						var r=xhr.responseText;
						console.log(r);
						if(r==1){
							d1.innerHTML="删除成功"
						}else(
						d1.innerHTML="删除失败"
						)
					
					}
				}
				xhr.open("delete",`/ajax/restful_del1/${$uid}`,true);
				xhr.send();
			}
		</script>
	</head>
	<body>
		
			<input type="text" id="uid"><br>
			<button onclick="del()">删除</button>
			<div id="d1"></div>
	</body>
</html>
